import 'package:flutter_test/flutter_test.dart';
import 'package:lib_common/lib_common.dart';
import 'package:lib_common/lib_common_platform_interface.dart';
import 'package:lib_common/lib_common_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockLibCommonPlatform
    with MockPlatformInterfaceMixin
    implements LibCommonPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final LibCommonPlatform initialPlatform = LibCommonPlatform.instance;

  test('$MethodChannelLibCommon is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelLibCommon>());
  });

  test('getPlatformVersion', () async {
    LibCommon libCommonPlugin = LibCommon();
    MockLibCommonPlatform fakePlatform = MockLibCommonPlatform();
    LibCommonPlatform.instance = fakePlatform;

    expect(await libCommonPlugin.getPlatformVersion(), '42');
  });
}
